
<%= form_for(@detalle_rt, :url => guardar_detalle_rt_path(@receiving_ticket), remote: true, :authenticity_token => true) do |f| %>
    <div class="in form-body form-partida" id="form-data">
        <div class="row">
            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Clave de RT</label>
                    <%= f.text_field :receiving_ticket_id, :value => @receiving_ticket.id,readonly: true,:class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-5">
                <div class="form-group campo-data">
                    <label class="label-block">Item</label>
                    <%= f.hidden_field :det_orden_compra_id %>
                    <%= f.collection_select :item_id, @items, :id, :nombre_select, {:prompt => '-- Seleccione el item --'}, {:class => "form-control input-sm combo-rt"} %>
                </div>
            </div>

            <div class="col-sm-5">
                <div class="form-group campo-data">
                    <label class="label-block">Proveedor</label>
                    <% if @mostrar_IdRTProveedor %>
                    	<%= f.hidden_field :proveedor_value, value: @receiving_ticket.IdRTProveedor %>
                    <% end %>
                    <%= f.collection_select :proveedor_id, @proveedores, :id, :NombreRazon, {:prompt => '-- Seleccione el proveedor --'}, {:class => "form-control input-sm combo-rt"} %>
                </div>
            </div>
        </div>

      Factura? <%= check_box_tag "factura" %>
        <div class="row" id="factura">
            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Factura</label>
                    <%=  f.text_field :factura, :class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Partida</label>
                    <%=  f.text_field :partida,:class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Hoja</label>
                    <%=  f.text_field :hoja,:class => "form-control input-sm" %>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="form-group campo-data">
                    <label>Descripción</label>
                    <%=  f.text_area :descripcion,:class => "form-control" %>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Fraccion Arancelaria</label>
                    <%=  f.text_field :fraccion_arancelaria,:class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Incidencia?</label>
                    <%=  check_box_tag :tiene_incidencia,:class => "form-control" %>
                    <%= f.select :incidencia, options_for_select([["Dañado", "D"], ["Faltante", "F"], ["Sobrante", "S"]], @detalle_rt.incidencia), {:prompt=>"-- Seleccione --"}, {:class => "form-control input-sm"} %>
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Descripcion Incidencia</label>
                    <%=  f.text_area :DescripcionIncidencia,:class => "form-control" %>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Origen</label>
                    <%=  f.collection_select :origen_id, @paises, :id,:Nombre, {:prompt => '-- Seleccione --'}, {:class => "form-control input-sm"} %>
                </div>
            </div>
        </div>

        <div class="row">
        	<div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Lote</label>
                    <%=  f.text_field :lote, required: true, :class => "form-control input-sm" %>
                </div>
            </div>
        	
            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Producci&oacute;n</label>
                    <%=  f.text_field :production,:class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Caducidad</label>
                    <%=  f.text_field :expiration,:class => "form-control input-sm" %>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Cantidad en Tarimas</label>
                    <%=  f.text_field :cantidad, :required => true, :class => "form-control input-sm"  %>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Empaque</label>
                    <%= f.collection_select :unidad_medida_id, @unidades_medida, :id, :Descripcion, {:prompt => '-- Seleccione --'}, {:class => "form-control input-sm"} %>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Contenido</label>
                    <%= f.text_field :cantidad_por_caja, :class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="form-group campo-data">
                    <label>Unidad medida</label>
                    <%= f.collection_select :unidad_medida_llegada_id, @unidades_medida, :id,:Descripcion, {:prompt => '-- Seleccione --'}, {:class => "form-control input-sm"} %>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Total de tarimas</label>
                    <%= f.text_field :total_cajas,:class => "form-control input-sm" %>
                </div>
            </div>

          
            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Total de piezas</label>
                    <%= f.text_field :total_piezas,:class => "form-control input-sm" %>
                </div>
            </div>

            <div class="col-sm-2">
                <div class="form-group campo-data">
                    
                    <label>Kilos</label>
                    <%=  f.text_field :kilos, :class => "form-control input-sm campo_numerico", required: 'required' %>
                </div>
            </div>
            
            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Libras</label>
                    <%= f.text_field :libras, :class => "form-control input-sm campo_numerico", required: 'required' %>
                </div>
            </div>
     
            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Total Kilos</label>
                    <%=  f.text_field :total_kilos,:class => "form-control input-sm campo_numerico", :readonly=> true %>
                </div>
            </div>

            <div class="col-sm-2">
                <div class="form-group campo-data">
                    <label>Total Libras</label>
                    <%= f.text_field :total_libras,:class => "form-control input-sm campo_numerico", :readonly=> true %>
                </div>
            </div>
        </div>

        <div class="row">
           <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Etiquetado</label>
                    <%=  f.check_box :etiquetado,:class => "form-control input-sm" %>
                    
                </div>
            </div>

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Tot etiquetas</label>
                    <%= f.text_field :tot_etiquetas,:class => "form-control input-sm" %>
                </div>
            </div>      
            

            <div class="col-sm-4">
                <div class="form-group campo-data">
                    <label>Localizacion</label>
                    <%= f.select :localizacion, options_for_select(get_ubicaciones, @detalle_rt.incidencia), {:prompt=>"-- Seleccione --"}, {:class => "form-control input-sm"} %>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="formulario-footer">
    <%= f.submit "Agregar", :class => "btn btn-primary" %>
</div>
<% end %>
